# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Sam Stuewe <halosghost at archlinux dot info>

pkgname=hashcat
pkgver=6.2.6
pkgrel=1
epoch=1
pkgdesc='Multithreaded advanced password recovery utility'
url='https://hashcat.net/hashcat'
arch=('loong64' 'x86_64')
depends=('ocl-icd' 'xxhash' 'zlib' 'minizip')
makedepends=('opencl-headers')
provides=('libhashcat.so')
license=('MIT')
source=(https://hashcat.net/files/${pkgname}-${pkgver}.tar.gz{,.asc})
sha512sums=('b5e4f40fb5ed0a47977243e1f95bf1deae0b04bd5ca26338395305c42573fe5b17557835f6f5d8b7402812e8eadda2b260d6b927ce99429fd1b87eb26f002f8a'
            'SKIP')
validpgpkeys=('A70833229D040B4199CC00523C17DA8B8A16544F') # Hashcat signing key <signing@hashcat.net>

build() {
  cd ${pkgname}-${pkgver}
  rm -rf deps/{OpenCL-Headers,xxHash}
  export CFLAGS+=" ${CPPFLAGS}"
  export CXXFLAGS+=" ${CPPFLAGS}"
  make \
    PREFIX=/usr \
    SHARED=1 \
    USE_SYSTEM_XXHASH=1 \
    USE_SYSTEM_OPENCL=1 \
    USE_SYSTEM_ZLIB=1
}

package() {
  cd ${pkgname}-${pkgver}
  make \
    DESTDIR="${pkgdir}" \
    PREFIX=/usr \
    SHARED=1 \
    USE_SYSTEM_XXHASH=1 \
    USE_SYSTEM_OPENCL=1 \
    USE_SYSTEM_ZLIB=1 \
    install
  install -Dm 644 docs/license.txt -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
